import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';

@Entity()
export class Trade {
  @PrimaryGeneratedColumn()
  id: number;

  // 新增修改==
  @Column({ comment: '' })
  userId: number;

  @Column({ comment: '' })
  userName: string;

  @Column({ comment: '用户交易方向标识' })
  userDirection: number;

  @Column({ comment: '新的交易数量' })
  newSize: number;

  @Column({ comment: '交易创建时间' })
  createTimeNew: string;

  @Column({ comment: '' })
  contractInfo: string;

  // 新增修改==

  @Column({ comment: '交易价格' })
  price: string;

  @Column({ comment: '交易文本标识' })
  text: string;

  @Column({ comment: '交易手续费' })
  fee: string;

  @Column({ comment: '积分手续费' })
  point_fee: string;

  @Column({ comment: '交易 ID' })
  trade_id: string;

  @Column({ comment: '交易合约，如 BTC_USDT' })
  contract: string;

  @Column({ comment: '交易角色，如 taker' })
  role: string;

  @Column({ comment: '订单 ID' })
  order_id: string;

  @Column({ comment: '交易数量' })
  size: number;

  @Column({ comment: '平仓数量' })
  close_size: number;

  @Column({ comment: '业务信息，如 ch:qidian' })
  biz_info: string;

  @Column({ comment: '修改文本标识' })
  amend_text: string;

  @CreateDateColumn({
    type: 'timestamp',
    nullable: false,
    name: 'create_time',
    comment: '创建时间',
  })
  create_time: Date;

  @UpdateDateColumn({
    type: 'timestamp',
    nullable: false,
    name: 'update_time',
    comment: '更新时间',
  })
  update_time: string;
}
